﻿
<%@ Page Title="" Language="C#" MasterPageFile="~/Store.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="GUI.Stores._Default" %>

<%@ Register Assembly="GUI.PaginationControl" Namespace="GUI.PaginationControl" TagPrefix="mcc" %>


<asp:content id="Content1" contentplaceholderid="head" runat="server">
    <title>Loja</title>
</asp:content>

<asp:content id="Content2" contentplaceholderid="ContentPlaceHolder1" runat="server">

        <asp:Label runat="server" Text="Produtos" Font-Size="Larger"></asp:Label>
        <mcc:PaginationControl ID="PageControlTop" runat="server" PageURI="Default.aspx"
            QueryStringParam="page" PagesShown="5" />

        <asp:GridView ID="GV_Produtos" runat="server" AutoGenerateColumns="false">
            <Columns>
                <asp:TemplateField ShowHeader="true" HeaderText="Comprar">
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="cb_buy" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Descrição" DataField="Designation" />
                <asp:BoundField HeaderText="Preço" DataField="Price" />
                <asp:BoundField HeaderText="Stock" DataField="Stock" />
                <asp:TemplateField ShowHeader="true" HeaderText="Quantidade">
                    <ItemTemplate>
                        <asp:TextBox runat="server" ID="tb_qtd" Text="0"></asp:TextBox>
                        <asp:HiddenField ID="hf_code" runat="server" Value='<%# Eval("Code") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

        <asp:Label ID="lb_NRegistos" runat="server" Text="Nº Registos por Página"></asp:Label>
        <asp:DropDownList ID="ddl_nRegistos" runat="server" 
            onselectedindexchanged="ddl_nRegistos_SelectedIndexChanged" AutoPostBack="true">
            <asp:ListItem Text="10" Value="10" /> 
            <asp:ListItem Text="25" Value="25" /> 
            <asp:ListItem Text="50" Value="50" /> 
        </asp:DropDownList>

        <br />

        <asp:Button ID="bt_comprar" runat="server" Text="Comprar" 
            onclick="bt_comprar_Click" />

</asp:content>
